import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 苏李涛
 * Date: 2024-04-28
 * Time: 23:01
 */
public class Array {
    public static void main(String[] args) {
        int[] array = {1,2,3,4};
        int[] array1 = new int[]{1,2};
        int[] array2 = new int[2];
        //操作数组的工具类:Arrarys
        String ret = Arrays.toString(array1);//使用Arrarys的toString，把传入的array参数的数组，以字符串形式打印出来
        System.out.println(ret + " ");

        /*for (int n : array1) {          //遍历array数组,取出每个元素放到n里
            System.out.print(n + " ");
        }*/
//        System.out.println(array1[1]);
//        for (int i = 0; i < array.length; i++) {
//            System.out.print(array[i] + " ");
//
//        }
//        System.out.println();
//
//        for (int i = 0; i < array1.length; i++) {
//            System.out.print(array1[i] + " ");
//
//        }
//        System.out.println();
//
//        for (int i = 0; i < array2.length; i++) {
//            System.out.println(array2[i]);
//
//        }

        int[] array3;
        array3 = new int[4];
        boolean[] flag = new boolean[3];//boolean类型为初始化，默认是全是false
    }
}
